cmake_minimum_required(VERSION 3.14)

project(frp-gui-configuration LANGUAGES CXX VERSION 1.0.0)

include(cmake/SparkWithGit.cmake)
spark_initialize_modules()

# 资源文件路径
set(QRC_SOURCES "")

add_executable(${PROJECT_NAME})
target_link_qt5(${PROJECT_NAME})
spark_framework_include_with_git(${PROJECT_NAME} 
    https://gitee.com/spark-framework-libs/spark-framework-features
    FEATURES baseutil)
spark_framework_include_with_git(${PROJECT_NAME} 
    https://gitee.com/zinface/qt.examples
    FEATURES linux_frp_gui_configuration)

# 示例集合
option(ENABLE_BUILD_EXAMPLES "Enable Build Examples." OFF)
if(ENABLE_BUILD_EXAMPLES)
    include(examples/dev.cmake)
endif(ENABLE_BUILD_EXAMPLES)

# 测试集合
option(ENABLE_BUILD_TESTS "Enable Build Tests." OFF)
if(ENABLE_BUILD_TESTS)
    add_subdirectory(tests)
endif(ENABLE_BUILD_TESTS)

# include(cmake/SparkDesktopMacros.cmake)
# 内容默认应用名称: Name= 应与项目名称相同
spark_desktop_macros(
    # 应用名称: Name=
    "Frp Gui Configuration"
    # 应用名称: Name[zh_CN]=
    "Frp 图形配置工具"
    # 应用说明: Comment=
    ""
    # 应用类型: Type=
    "Application"
    # 执行程序: Exec=
    "/usr/bin/${PROJECT_NAME}"
    # 图标路径: Icon=
    "/usr/share/${PROJECT_NAME}/icon.png"
    # 应用分类: Categories=
    ""
    # MIME类型: MimeType=
    ""
)
install(TARGETS ${PROJECT_NAME}
    DESTINATION /usr/bin)
install(FILES assets/icon.png
    DESTINATION /usr/share/${PROJECT_NAME})
install(FILES ${SPARK_DESKTOP_FILE}
    DESTINATION /usr/share/applications)

# find_package(SparkDebPackage PATHS ${CMAKE_SOURCE_DIR})
add_package_descript(cmake/spark-deb-package.descript)